home *** CD-ROM | disk | FTP | other *** search
- Here is something that will test the number crunching ability of
- your ST. There are some fairly extensive trigonometric calculations
- in places.
-
- This program computes data for the sun and moon. It was made with the
- intent of printing monthly tables of sunrise and sunset or moon rise
- and moon set. The program is based on several articles published in
- Weatherwise magazine and expanded upon to add an easy to use user
- interface. The program was first written on a Prime computer using
- Fortran 77. It was then converted to Megamax C for the Atari ST. Finally
- after discovering the floating point calculations were fairly slow,
- it was converted to GFA basic which was about 5 times faster.
-
- The rise and set computations are valid for a flat horizon at sea level.
- Adjustments would have to be made for the actual times and angles
- where there are hills on the horizon or where the location is at
- a higher elevation. Care has been made to insure accuracy at high
- latitudes (don't try the north pole). In its present form the program
- will not correctly perform computations for latitudes south of the
- equator.
-
- In order to run the program a file called LATLON.DAT is required.
- This file contains data for specific locations including latitude,
- longitude, number of hours from UTC meridian, and whether daylight
- savings time is used. This enables fast access by locating file
- data when required by the program. The LATLON file can be added to
- through the program. It also can be added to or modified through a
- file editor or word processor. LATLON city names should be in capital
- letters, the latitudes and longitudes are entered (in the file only)
- without a decimal point. Hour differences from the 0 degree meridian
- are positive for west longitudes and negative for east longitudes.
- About two cities from each state some foreign locations are included
- in the LATLON.DAT file. The maximum entries allowable in LATLON.DAT
- is 500.
-
- Medium or high resolution is required. When the program begins the
- first location in the file is displayed in the status line at the
- bottom of the screen. To change this start up location you have to edit
- the LATLON file. To change the month of computation select the data
- entry in the menu bar or the F1 key. Enter the month in number or
- three letter format. Similarly the year can be changed using the data
- entry menu or the F2 key. Years require 4 number format. To change the
- location for the computation use the data entry menu or the F3 key. It
- is not necessary to type the entire city name. The location with the
- first characters in the LATLON file that match your entry will be
- selected. For example to call up Los Angeles you would only need to
- type L if it was the first L location in the file. If not Lo or Los
- would probably work. Changes you make are displayed in the status line
- at the screen bottom.
-
- The F4 key or compute in the data entry menu will start computation.
- Listing to the screen may be stopped at any time by pressing a key.
- Another key press will resume the computation.
-
- The options menu in the menu bar enables computation change from the
- sun to the moon. Click on your choice. Default is the sun on program
- start up. Also through the options menu you may display the entire
- list of locations available. Another option enables you to enter data
- for a new place. For instance you could type data for your own residence.
- Follow the prompts. Latitudes and longitudes are entered in degrees and
- hundredths, not minutes.
-
- Output to the printer may be selected through the options menu or the
- F5 key. When the printer is selected all computed output goes to the
- printer instead of the monitor screen. Make sure you have the printer
- turned on in advance.
-
- Quit in the options menu or the F6 key is the only way to gracefully
- exit the program.
-
- In addition there is a choice of 3 different types of twilight for
- the sun computations. The default is civil twilight which begins or
- ends when the sun is 6 degrees below the horizon. You may also
- select nautical twilight, when the sun is 12 degrees below the
- horizon or astronomical twilight when the sun is 18 degrees below
- the horizon.
-
- Output shows rise and set times and day lengths in hours and minutes.
- Times should be accurate to less than 1 minute for the sun and within a
- few minutes for the moon, probably better at low latitudes than at high
- latitudes. Change in day length is in minutes and seconds. Azimuth
- angles of rise and set on the horizon are measured from true north and
- are in degrees and tenths. Maximum elevations are also measured in
- degrees and tenths. Transit or solar noon is the time that the sun
- or moon is on the horizon due south. It is given to the nearest second
- for the sun. This enables an observer to determine the location of
- due south. Full moon occurs when the phase is shown to be .99.
-
- There are centain conditions where there are no rise or set times for
- a day. It is also possible to have two sunsets on the same day!
- The following conventions are used in the times showing these conditions:
-
- ..:.. Indicates there is no rise or set for this day, it occurs on the
- following day.
- --:-- Indicates there is no rise or set for this day because the sun
- or moon stays below the horizon.
- **:** Indicates there is no rise or set for this day because the sun
- or moon remains above the horizon.
-
- Revision 1.1 added the following...
- Through a line editor or word processor you may add elevation after the
- UTC/local time difference in columns 33 through 37. Normally this is not
- used but in the case where the observer is on a high mountain and
- the horizon is near sea level it will make several minutes difference
- in sunrise and sunset. This elevation is not computation is not done
- for moonrise and moonset.
-
- The status display line at the screen bottom was fixed to show correct
- latitude and longitude.
-
- Tests were inserted for screen resolution and printer status.
-
- A file called DATLOC.DAT was added which remembers the last location,
- month, and year used so when the program is rerun the same data
- will be used.
-
- Suggestions for improvements are welcome. Write:
-
- Dave Henry
- 1720 Wickersham Drive
- Anchorage, Alaska 99507
-
-